import 'package:flutter/material.dart';

class AnimatedContainerApi extends StatefulWidget {
  AnimatedContainerApi({Key key}) : super(key: key);

  @override
  _AnimatedContainerApiState createState() => _AnimatedContainerApiState();
}

class _AnimatedContainerApiState extends State<AnimatedContainerApi> {
  bool click = false;
  @override
  Widget build(BuildContext context) {
    return Container(
      child: Center(
          child: GestureDetector(
        onTap: () {
          setState(() {
            click = !click;
          });
        },
        child: AnimatedContainer(
            duration: Duration(seconds: 1),
            height: click ? 200 : 300,
            color: Colors.blue,
            width: click ? 200 : 300),
      )),
    );
  }
}
